package com.cdut.hwadeefsc.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 学生成绩表
 * @TableName scores
 */
@TableName(value ="scores")
public class scores {
    /**
     * 主键ID
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 学生ID (关联 users.id)
     */
    private Long studentId;

    /**
     * 学籍系统中的学号，用于对接
     */
    private String externalStudentNo;

    /**
     * 考试名称 (e.g., "期中考试")
     */
    private String examName;

    /**
     * 科目
     */
    private String subject;

    /**
     * 成绩 (例如 98.50)
     */
    private BigDecimal score;

    /**
     * 录入老师ID (关联 users.id)
     */
    private Long recordedBy;

    /**
     * 录入时间
     */
    private Date createdAt;

    /**
     * 主键ID
     */
    public Long getId() {
        return id;
    }

    /**
     * 主键ID
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * 学生ID (关联 users.id)
     */
    public Long getStudentId() {
        return studentId;
    }

    /**
     * 学生ID (关联 users.id)
     */
    public void setStudentId(Long studentId) {
        this.studentId = studentId;
    }

    /**
     * 学籍系统中的学号，用于对接
     */
    public String getExternalStudentNo() {
        return externalStudentNo;
    }

    /**
     * 学籍系统中的学号，用于对接
     */
    public void setExternalStudentNo(String externalStudentNo) {
        this.externalStudentNo = externalStudentNo;
    }

    /**
     * 考试名称 (e.g., "期中考试")
     */
    public String getExamName() {
        return examName;
    }

    /**
     * 考试名称 (e.g., "期中考试")
     */
    public void setExamName(String examName) {
        this.examName = examName;
    }

    /**
     * 科目
     */
    public String getSubject() {
        return subject;
    }

    /**
     * 科目
     */
    public void setSubject(String subject) {
        this.subject = subject;
    }

    /**
     * 成绩 (例如 98.50)
     */
    public BigDecimal getScore() {
        return score;
    }

    /**
     * 成绩 (例如 98.50)
     */
    public void setScore(BigDecimal score) {
        this.score = score;
    }

    /**
     * 录入老师ID (关联 users.id)
     */
    public Long getRecordedBy() {
        return recordedBy;
    }

    /**
     * 录入老师ID (关联 users.id)
     */
    public void setRecordedBy(Long recordedBy) {
        this.recordedBy = recordedBy;
    }

    /**
     * 录入时间
     */
    public Date getCreatedAt() {
        return createdAt;
    }

    /**
     * 录入时间
     */
    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        scores other = (scores) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getStudentId() == null ? other.getStudentId() == null : this.getStudentId().equals(other.getStudentId()))
            && (this.getExternalStudentNo() == null ? other.getExternalStudentNo() == null : this.getExternalStudentNo().equals(other.getExternalStudentNo()))
            && (this.getExamName() == null ? other.getExamName() == null : this.getExamName().equals(other.getExamName()))
            && (this.getSubject() == null ? other.getSubject() == null : this.getSubject().equals(other.getSubject()))
            && (this.getScore() == null ? other.getScore() == null : this.getScore().equals(other.getScore()))
            && (this.getRecordedBy() == null ? other.getRecordedBy() == null : this.getRecordedBy().equals(other.getRecordedBy()))
            && (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getStudentId() == null) ? 0 : getStudentId().hashCode());
        result = prime * result + ((getExternalStudentNo() == null) ? 0 : getExternalStudentNo().hashCode());
        result = prime * result + ((getExamName() == null) ? 0 : getExamName().hashCode());
        result = prime * result + ((getSubject() == null) ? 0 : getSubject().hashCode());
        result = prime * result + ((getScore() == null) ? 0 : getScore().hashCode());
        result = prime * result + ((getRecordedBy() == null) ? 0 : getRecordedBy().hashCode());
        result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", studentId=").append(studentId);
        sb.append(", externalStudentNo=").append(externalStudentNo);
        sb.append(", examName=").append(examName);
        sb.append(", subject=").append(subject);
        sb.append(", score=").append(score);
        sb.append(", recordedBy=").append(recordedBy);
        sb.append(", createdAt=").append(createdAt);
        sb.append("]");
        return sb.toString();
    }
}